package com.itfenghuang.day02;

public class A05_练习12题 {
    public static void main(String[] args) {

        Computer1 computer1 = new Computer1();
        Mouse mouse = new Mouse();
        Keybord keybord = new Keybord();
        computer1.gg(mouse,keybord);
    }
}

interface USB1{
    void open();
    void close();
}
class Mouse implements USB{
    @Override
    public void open() {
        System.out.println("连接鼠标的USB");
    }
    @Override
    public void close() {
        System.out.println("断开鼠标的USB");
    }
}
class Keybord implements USB1{

    @Override
    public void open() {
        System.out.println("连接键盘的USB");
    }

    @Override
    public void close() {
        System.out.println("断开键盘的USB");
    }
}
class Computer1 implements USB1{
    @Override
    public void open() {
        System.out.println("开机");
    }
    @Override
    public void close() {
        System.out.println("关机");
    }
    public void gg(Mouse mouse,Keybord keybord){
        mouse.open();
        mouse.close();
        keybord.open();
        keybord.close();
    }
}
